# coding:utf-8

import xlrd

'''
Excel 测试
pip install xlrd -i https://mirrors.aliyun.com/pypi/simple
'''


def operator():
    xlsx = xlrd.open_workbook('D:\\CodeS\\YinYangShiFuZhu\\resource\\test.xlsx')

    worksheet = xlsx.sheet_by_name(u'Sheet1')

    nrows = worksheet.nrows
    ncols = worksheet.ncols

    for rownum in range(0, nrows):
        for colnum in range(0, ncols):
            data = worksheet.cell(rownum, colnum)
            print data.value.encode('utf-8')  # 不编码会有问题


if __name__ == '__main__':
    operator()
